

#import <UIKit/UIKit.h>

enum{
    NO_ERROR = 0,
    NETWORK_UNAVAILABLE = 1,//判断网络不可用时返回该错误码
    NETWORK_ERROR = 2,//http返回非200
    //REQUEST_TIMEOUT = 3,
    //REQUEST_ERROR = 4,//http返回值200,但协议头数据标记失败
    RESPONSE_PARSE_ERROR = 5,//http返回数据200,但解析数据（目前时json）失败
    RESPONSE_PARSE_RET_ERROR = 6,//逻辑解析后ret非0
    REQUEST_URL_NOFOUND = 7, //找不到配置里的url
    RESPONSE_TYPE_NOFOUND = 8, //找不到对应处理的response
    RESPONSE_DATA_NIL = 9 //200返回data数组为空
};

enum{
    RET_DEFAULT_ERROR = -1,
    RET_SUCCESS = 0
};

@class BaseRequest;
@interface BaseResponse : NSObject
{
    NSData* _data;
    BaseRequest* _request;
    NSString *_msg;
    int _errcode;
}
@property (nonatomic, assign) NSInteger errorType;
@property (nonatomic, assign) NSInteger ret;
@property (nonatomic, retain) NSString* msg;
@property (nonatomic, retain) NSString* errorstring;
@property (nonatomic, assign) int errcode;
@property (nonatomic, retain) NSData* data;
@property (nonatomic, retain) BaseRequest* request;
-(void)parse;
@end
